﻿using sql_data_generator.FieldOptions;
using sql_data_generator.Generators;

namespace sql_data_generator.Randomizers
{
    class RandomizerInteger : BaseRandomizer<FieldOptionsInteger>, IRandomizer
    {
        private readonly RandomIntegerGenerator _generator;

        public RandomizerInteger(FieldOptionsInteger options): base(options)
        {
            _generator = new RandomIntegerGenerator(options.Min, options.Max);
        }

        public object GetData()
        {
            return IsNull() ? null : (int?)_generator.Generate();
        }
    }
}